﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using Entity;
using BUS;
using DataAccess;
namespace QuanLyDiemSV
{
    public partial class KetQuaHocTap : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string masv = "S01";
                Label4.Text = BUS.XemKetQuaHocTap_BUS.HienThiTen(masv);
                Label5.Text = masv;
                Label6.Text = BUS.XemKetQuaHocTap_BUS.HienThiLop(masv);
                BUS.XemKetQuaHocTap_BUS.HienThiTen(masv);
                DataTable dt = new DataTable();
                dt = BUS.XemKetQuaHocTap_BUS.XemKetQuaHocTap(masv);
                GridView1.DataSource = dt;
                GridView1.DataBind();
            }
        }

        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            GridView1.PageIndex = e.NewPageIndex;
            this.BindGrid();
        }
        public void BindGrid()
        {
            string str = "EXEC DiemHocTap S01";
            SqlConnection con = new SqlConnection("Data Source=MINHHIEP\\SQLEXPRESS;Initial Catalog=QUANLYDIEM;Integrated Security=True");
            SqlDataAdapter da = new SqlDataAdapter(str, con);
            DataSet dt = new DataSet();
            da.Fill(dt);
            GridView1.DataSource = dt.Tables[0].DefaultView;
            GridView1.DataBind();
            con.Close();
        }
    }
}